define_extension :sources, :http do
  require 'open-uri'
  
  set(:http_sources_to) { File.basename(http_sources_from) } unless exists?(:http_sources_to)
  
  task :sources do
    brev = build_repository[real_revision]
    brev.setup!

    logger.debug("fetching #{fetch(:http_sources_from)} to #{fetch(:http_sources_to)}")
    open fetch(:http_sources_from) do |fin|
      open(File.join(brev.src_path, fetch(:http_sources_to)), "w") do |fout|
        fout.write(fin.read)
      end
    end    
  end
end

